package com.ficus.road.maintain.dao.smart;

import com.ficus.road.maintain.core.dao.BaseMongoDao;
import com.ficus.road.maintain.core.model.smart.RoadRanktable;
import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.core.index.Index;
import org.springframework.stereotype.Component;

@Component
public class RoadRanktableDao extends BaseMongoDao<RoadRanktable, String> {

    @Override
    public void indexOperation() {
        super.getMongoTemplate().indexOps(getCollectionName()).ensureIndex(new Index().on("area", Sort.Direction.DESC).background());
    }

    @Override
    public String getCollectionName() {
        return "road_ranktable";
    }
}
